const mongoose=require("mongoose")
let Schema=mongoose.Schema;

mongoose.connect("mongodb://127.0.0.1:27017/blog",{
    useNewUrlParser:true,
    useUnifiedTopology:true
}).then(()=>{
    console.log("数据库连接成功")
})

let messageTable=mongoose.model("messageTable",new Schema({
    currentTime:{
        type:Date,
        default:Date.now
    },
    say:{
        type:String
    },
    name:{
        type:String,
        required:true,
        default:"http://localhost:8888/img/upload/avatar/file-1591171211208.jpg"
    }
}))

module.exports={
    messageTable
}